home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Bombardier_PC
/
BSCRIPTS.CST
/
00094_Script_category
< prev
next >
Wrap
Text File
|
1999-04-25
|
6KB
|
219 lines
-- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
-- Developed for Bombardier, Inc.
--
-- All programming developed by:
-- Robert Fabricant, Valerie Valoueva, Ossi Shaked,
-- Henry Sauvageot, Chris Howell & Chris Girand
--
-- Use of this code by parties other than @radical.media, inc. or their
--agents
-- without the express written consent of @radical.media, inc. AND Concurrent
-- New Media Group, L.L.C. is strictly prohibited.
------------------------------------------------------
property mySprite, myNormal, myRoller, myHilite, selected, myName, myFrame, myType, myGroup, lastSelected,catEnabled
global lastSub
on new me
global menuController
set mySprite = the spritenum of me
set myNormal = the member of sprite mySprite
set myName = the name of member the member of sprite mySprite
set hilName = myName&"-hil"
set rollName = myName&"-roll"
set myRoller = member rollName
set myHilite = member hilName
set selected = 0
set catEnabled = 0--This property controls the following functionality:
--lets you to jump to category section by clicking
--on a categoty while in a subcategory section
--and a subcategory menu is open
set scriptNum = the scriptNum of sprite mySprite
set myType = the name of member scriptNum
register menuController, me, myName
puppetSprite mySprite, true
return me
end
on setFrame me, theFrame
set myFrame = theFrame
end
on heresYourGroup me, theGroup
set myGroup = theGroup
end
on setLastSelected me, theLastSelObj
set lastSelected = theLastSelObj
end
on getType me
return myType
end
-- the 2 rollover handlers
on mouseEnter me
if not selected then
puppetsound 3, "subrollOldOld"
set the member of sprite mySprite = member myRoller
else
repeat with i = 1 to count(myGroup)
set thisGuy = getat(myGroup, i)
set hisType = getType(thisGuy)
if hisType = "knob" then
mouseEnter thisGuy --hilite the knob when rolled over a category
end if
end repeat
end if
-- hilite a selected category when rolled over it, if a subcategory menu is open
if catEnabled then
set the member of sprite mySprite = member myRoller
puppetsound 3,"subrollOldOld"
end if
end
on mouseLeave me
if not selected then
set the member of sprite mySprite = member myNormal
else
repeat with i = 1 to count(myGroup)
set thisGuy = getat(myGroup, i)
set hisType = getType(thisGuy)
if hisType = "knob" then
mouseLeave thisGuy --get rid of a knob hilite when rolled off a category
end if
end repeat
end if
-- selected category returns to it's previous state
-- when rolled off it, if a subcategory menu is open
if catEnabled then
set the member of sprite mySprite = member myHilite
end if
end
on mouseUp me
global comefromQTVR
-- Reset global variable "comefromQTVR" which controls visibility of the "return to aircraft" button in cabin details section
set comefromQTVR = FALSE
set the visible of sprite 110 = TRUE
if not selected or catEnabled then
if catEnabled then set shouldHide = TRUE
set lastSub = void
IWasSelected lastSelected, me
set the member of sprite mySprite = member myHilite
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
set type = getType(teamMate)
if type = "category" then
nothing
else
if type = "knob" then
-- Category is selected for the first time,
-- so when subcategory menu opens, no subcategory should be hilited
deleteSub(teamMate)
else if type = "subCategory" then
--Make sure to hilite subcategory item which takes you to the same frame
if myFrame = getFrame(teamMate) then
reset teamMate
setSubCat me, teamMate
end if
end if
if not selected then
showYourSelf teamMate
end if
if shouldHide then
hideYourSelf teamMate
end if
end if
end repeat
set catEnabled = 0
set selected = 1
set thisMovie = the movie
if thisMovie = "bjs.dir" or thisMovie = "cs.dir" or thisMovie = "bombinc.dir" then
nothing
else
ResetTour
closeMovie
end if
puppetsprite 22, false
clearpups
sendAllSprites(#qtvrPuppetOff, myFrame)
go to frame myFrame
puppetsound 3, "mouse5"
sound stop(1)
sound stop(2)
else
--reopen subcategory menu, which was folded up by knob
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
showYourSelf teamMate
end repeat
if not voidP(lastSub) then
--hilite selected subcategory
reset lastSub
end if
setCatEnable me, TRUE
end if
end
on setSubCat me, theSub
set lastSub = theSub
end
on deselect me
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
disable teamMate
end repeat
end
on disable me
set selected = 0
set catEnabled = 0
set the member of sprite mySprite = member myNormal
end
on hideYourSelf me
set selected = 1
set the member of sprite mySprite = member myHilite
end
on showYourSelf me
set selected = 1
set the member of sprite mySprite = member myHilite
end
on setCatEnable me, TrueOrFalse
if marker(0) <> label(myFrame) then
set catEnabled = TrueOrFalse
end if
end
-- not called in this application, but necessary to call on menuController, if the "behaviour line" is ever broken in any movie
on endPuppeting me
puppetSprite mySprite, false
end